<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body{
      margin: 0;
      padding: 0;
      height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(125deg,#2c3e50,#27ae60,#2980b9,#e74c3c,#8e44ad);
      /* 指定背景图大小 */
      background-size: 500%;
      animation: bgAnimate 15s linear infinite;
    }
    .text{
      color: #fff;
      font-size: 30px;
      letter-spacing: 15px;
    }
    @keyframes bgAnimate {
      0%{
        background-position: 0% 50%;
      }
      50%{
        background-position: 100% 50%;
      }
      100%{
        background-position: 0% 50%;
      }
    }
  </style>
</head>
<body>
  <div class="text">背景动画</div>
</body>
</html>